﻿import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 重定向
  {
    path: '/',
    redirect: '/index'
  },
  // 首页
  {
    path: '/index',
    name: 'index',
    component: () => import('@v/index/index.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 文章详情页
  {
    path: '/detail',
    name: 'detail',
    component: () => import('@v/articleDetail/detail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 个人中心
  {
    path: '/mine',
    name: 'mine',
    component: () => import('@v/mine/mine.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 基本信息
  {
    path: '/personal',
    name: 'personal',
    component: () => import('@v/mine/personal.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 实名认证
  {
    path: '/certification',
    name: 'certification',
    component: () => import('@v/mine/certification.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 设置姓名
  {
    path: '/settingname',
    name: 'settingname',
    component: () => import('@v/mine/settingname.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 绑定银行卡
  {
    path: '/bindbankcard',
    name: 'bindbankcard',
    component: () => import('@v/mine/bindbankcard.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 输入支付密码
  {
    path: '/paymentcode',
    name: 'paymentcode',
    component: () => import('@v/mine/paymentcode.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 设置支付密码
  {
    path: '/settingpayPassword',
    name: 'settingpayPassword',
    component: () => import('@v/mine/settingpayPassword.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 我的二维码
  {
    path: '/code',
    name: 'code',
    component: () => import('@v/mine/code.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 任务中心 finish
  {
    path: '/task',
    name: 'task',
    component: () => import('@v/task/task.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 已完成任务 
  {
    path: '/taskFinish',
    name: 'taskFinish',
    component: () => import('@v/task/finish.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 推广任务 
  {
    path: '/extendTask',
    name: 'extendTask',
    component: () => import('@v/task/extendTask.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },

  // 任务详情s 
  {
    path: '/taskDetails',
    name: 'taskDetails',
    component: () => import('@v/task/taskDetails.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 任务详情 
  {
    path: '/taskDetail',
    name: 'taskDetail',
    component: () => import('@v/task/taskDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },

  // 分享记录
  {
    path: '/share',
    name: 'share',
    component: () => import('@v/share/share.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 搜索页
  {
    path: '/search',
    name: 'search',
    component: () => import('@v/search/search.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 文章分享页
  {
    path: '/sharedetail',
    name: 'sharedetail',
    component: () => import('@v/articleDetail/sharedetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 文章分享设置页
  {
    path: '/shareEdit',
    name: 'shareEdit',
    component: () => import('@v/articleDetail/shareEdit.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
  // 客户管理
  {
    path: '/customer',
    name: 'customer',
    component: () => import('@v/customer/customer.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    }
  },
  // 海报详情
  {
    path: '/postDetail',
    name: 'postDetail',
    component: () => import('@v/postDetail/postDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //海报分享详情
  {
    path: '/postShareDetail',
    name: 'postShareDetail',
    component: () => import('@v/postDetail/postShareDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //海报分享设置
  {
    path: '/postShareEdit',
    name: 'postShareEdit',
    component: () => import('@v/postDetail/postShareEdit.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 视频详情
  {
    path: '/videoDetail',
    name: 'videoDetail',
    component: () => import('@v/videoDetail/videoDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //视频分享详情
  {
    path: '/videoShareDetail',
    name: 'videoShareDetail',
    component: () => import('@v/videoDetail/videoShareDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //视频分享设置
  {
    path: '/videoShareEdit',
    name: 'videoShareEdit',
    component: () => import('@v/videoDetail/videoShareEdit.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //创建营销内容
  {
    path: '/marketing',
    name: 'marketing_index',
    component: () => import('@v/marketing/index.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },

  //创建文章
  {
    path: '/addAticle',
    name: 'marketing_addAticle',
    component: () => import('@v/marketing/addAticle.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //创建文章下一步
  {
    path: '/addArticleNext',
    name: 'marketing_addArticleNext',
    component: () => import('@v/marketing/addArticleNext.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },

  //创建海报
  {
    path: '/addPoster',
    name: 'marketing_addPoster',
    component: () => import('@v/marketing/addPoster.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //创建海报下一步
  {
    path: '/addPosterNext',
    name: 'marketing_addPosterNext',
    component: () => import('@v/marketing/addPosterNext.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //创建视频
  {
    path: '/addVideo',
    name: 'marketing_addVideo',
    component: () => import('@v/marketing/addVideo.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //创建视频下一步
  {
    path: '/addVideoNext',
    name: 'marketing_addVideoNext',
    component: () => import('@v/marketing/addVideoNext.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //分享后的页面
  {
    path: '/details',
    name: 'details',
    component: () => import('@v/recruitment/detail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //表单提交列表
  {
    path: '/form',
    name: 'form',
    component: () => import('@v/form/index.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //提交客户详情
  {
    path: '/formDetail',
    name: 'formDetail',
    component: () => import('@v/form/formDetail.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //提交客户列表
  {
    path: '/formList',
    name: 'formList',
    component: () => import('@v/form/formList.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //注册认证
  {
    path: '/mineLogin',
    name: 'mine',
    component: () => import('@v/mine/login.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //注册成功
  {
    path: '/loginSuccess',
    name: 'loginSuccess',
    component: () => import('@v/mine/loginSuccess.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //管理端使用说明
  {
    path: '/mineInstructions',
    name: 'mineInstructions',
    component: () => import('@v/mine/instructions.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //我的钱包
  {
    path: '/wallet',
    name: 'wallet',
    component: () => import('@v/wallet/index.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 提现
  {
    path: '/withdrawdeposit',
    name: 'withdrawdeposit',
    component: () => import('@v/wallet/withdrawdeposit.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 充值
  {
    path: '/topup',
    name: 'topup',
    component: () => import('@v/wallet/topup.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 充值明细
  {
    path: '/moneydetail',
    name: 'moneydetail',
    component: () => import('@v/wallet/moneydetail.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 提现和实名认证信息提示
  {
    path: '/message',
    name: 'message',
    component: () => import('@v/wallet/message.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 我的订单
  {
    path: '/order',
    name: 'order',
    component: () => import('@v/order/index.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //文章
  {
    path: '/atricle',
    name: 'atricle',
    component: () => import('@v/articleDetail/atricle.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //视频
  {
    path: '/video',
    name: 'video',
    component: () => import('@v/videoDetail/video.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //海报
  {
    path: '/post',
    name: 'post',
    component: () => import('@v/postDetail/post.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },

  // 招聘详情
  {
    path: '/recruitmentdetail',
    name: 'recruitmentdetail',
    component: () => import('@v/recruitment/recruitmentDetail.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //分享编辑
  {
    path: '/recruitmentedit',
    name: 'recruitmentedit',
    component: () => import('@v/recruitment/recruitmentEdit.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 招聘详情
  {
    path: '/recruitmentdetails',
    name: 'recruitmentdetails',
    component: () => import('@v/recruitment/recruitmentdetails.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 招聘
  {
    path: '/recruitment',
    name: 'recruitment',
    component: () => import('@v/recruitment/recruitment.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 推广和发布
  {
    path: '/releasepromotion',
    name: 'releasepromotion',
    component: () => import('@v/recruitment/releasepromotion.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 招聘推广和发布
  {
    path: '/addRecruitment',
    name: 'addRecruitment',
    component: () => import('@v/recruitment/addRecruitment.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 招聘推广和发布
  {
    path: '/addRecruitmentNext',
    name: 'addRecruitmentNext',
    component: () => import('@v/recruitment/addRecruitmentNext.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 我的简历
  {
    path: '/resume',
    name: 'resume',
    component: () => import('@v/resume/resume.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 我的简历
  {
    path: '/resumes',
    name: 'resumes',
    component: () => import('@v/resume/resumes.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 在线简历
  {
    path: '/onlineresume',
    name: 'onlineresume',
    component: () => import('@v/resume/onlineresume.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //绑定企业账号 
  {
    path: '/boundFirm',
    name: 'boundFirm',
    component: () => import('@v/mine/boundFirm.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //发布文章 
  {
    path: '/publishArticle',
    name: 'publishArticle',
    component: () => import('@v/articleDetail/publishArticle.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //文章素材库
  {
    path: '/articleMaterial',
    name: 'articleMaterial',
    component: () => import('@v/articleDetail/articleMaterial.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //发布视频 
  {
    path: '/publishVideo',
    name: 'publishVideo',
    component: () => import('@v/videoDetail/publishVideo.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  //发布海报
  {
    path: '/publishPost',
    name: 'publishPost',
    component: () => import('@v/postDetail/publishPost.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },


  // 账号失效
  {
    path: '/default',
    name: 'default',
    component: () => import('@v/dafault/default.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //账号链接失效
  {
    path: '/noLink',
    name: 'noLink',
    component: () => import('@v/dafault/noLink.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无活动
  {
    path: '/noActivity',
    name: 'noActivity',
    component: () => import('@v/dafault/noActivity.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无文章
  {
    path: '/noArticle',
    name: 'noArticle',
    component: () => import('@v/dafault/noArticle.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无海报
  {
    path: '/noPost',
    name: 'noPost',
    component: () => import('@v/dafault/noPost.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无视频
  {
    path: '/noVideo',
    name: 'noVideo',
    component: () => import('@v/dafault/noVideo.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无招聘
  {
    path: '/noInvite',
    name: 'noInvite',
    component: () => import('@v/dafault/noInvite.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //暂无兼职
  {
    path: '/noJob',
    name: 'noJob',
    component: () => import('@v/dafault/noJob.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 我的简历
  {
    path: '/resume',
    name: 'resume',
    component: () => import('@v/resume/resume.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 在线简历
  {
    path: '/onlineresume',
    name: 'onlineresume',
    component: () => import('@v/resume/onlineresume.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线简易简历
  {
    path: '/briefonlineresume',
    name: 'briefonlineresume',
    component: () => import('@v/resume/briefonlineresume.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线简易简历
  {
    path: '/resumedetailmsg',
    name: 'resumedetailmsg',
    component: () => import('@v/resume/resumedetailmsg.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线简易简历
  {
    path: '/briefonlineresumes',
    name: 'briefonlineresumes',
    component: () => import('@v/resume/briefonlineresumes.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线详细简历
  {
    path: '/detailedonlineresume',
    name: 'detailedonlineresume',
    component: () => import('@v/resume/detailedonlineresume.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线详细简历
  {
    path: '/detailedonlineresumes',
    name: 'detailedonlineresumes',
    component: () => import('@v/resume/detailedonlineresumes.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线简易简历-表单
  {
    path: '/briefonlineresumeform',
    name: 'briefonlineresumeform',
    component: () => import('@v/resume/briefonlineresumeform.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线简易简历-表单
  {
    path: '/briefonlineresumeforms',
    name: 'briefonlineresumeforms',
    component: () => import('@v/resume/briefonlineresumeforms.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线详细简历-表单
  {
    path: '/detaildonlineresumeform',
    name: 'detaildonlineresumeform',
    component: () => import('@v/resume/detaildonlineresumeform.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 在线详细简历-表单
  {
    path: '/detaildonlineresumeforms',
    name: 'detaildonlineresumeforms',
    component: () => import('@v/resume/detaildonlineresumeforms.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 简易在线简历
  {
    path: '/simpleresume',
    name: 'simpleresume',
    component: () => import('@v/resume/simpleresume.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //管理员设置
  {
    path: '/admin',
    name: 'admin',
    component: () => import('@v/admin/admin.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //添加管理员
  {
    path: '/addAdmin',
    name: 'addAdmin',
    component: () => import('@v/admin/addAdmin.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  //申请管理员
  {
    path: '/applyAdmin',
    name: 'applyAdmin',
    component: () => import('@v/admin/applyAdmin.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 浏览记录
  {
    path: '/browsinghistory',
    name: 'browsinghistory',
    component: () => import('@v/mine/browsinghistory.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // pdf预览
  {
    path: '/pdfpreview',
    name: 'pdfpreview',
    component: () => import('@v/recruitment/pdfpreview.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    },
  },
  // 文章预览
  {
    path: '/previewArticle',
    name: 'previewArticle',
    component: () => import('@v/articleDetail/previewArticle.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 推广审核
  {
    path: '/proCheck',
    name: 'proCheck',
    component: () => import('@v/proCheck/proCheck.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
  // 招聘文案
  {
    path: '/recruitmentmaterial',
    name: 'recruitmentmaterial',
    component: () => import('@v/recruitment/recruitmentMaterial.vue'),
    meta: {
      TabbarShow: true, //是否开启tabbar
    },
  },
   // 阅读信息
   {
    path: '/recruitmenttestDetail',
    name: 'recruitmenttestDetail',
    component: () => import('@v/recruitment/recruitmenttestDetail.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },
   // 帮助中心
   {
    path: '/help',
    name: 'help',
    component: () => import('@v/help/help.vue'),
    meta: {
      TabbarShow: false, //是否开启tabbar
    }
  },

]


const router = new VueRouter({
  // mode: "hash",
  mode: 'history',
  // base: '/jxt/',
  base: "/wx/",

  routes,

})
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
router.beforeEach((to, from, next) => {
  const u = navigator.userAgent
  const isIOS = !!u.match(/\i[^;]+;(U;)? CPU.+Mac OS X/) //iOS终端
  // 修复iOS版微信H5页面History兼容性问题
  if (isIOS && to.path !== location.pathname) {
    location.assign(to.fullPath)
  } else {
    next()
  }
})

export default router